#include<bits/stdc++.h>
#define int long long
using namespace std;
const int N=1e5+5,M=125,mod=998244353,base=10;
inline int read(){
	int x=0,f=1;char ch=getchar();
	while(!isdigit(ch)){if(ch=='-')f=-1;ch=getchar();}
	while(isdigit(ch)){x=(x<<1)+(x<<3)+ch-48,ch=getchar();}
	return x*f;
}
int n,m,idx;

vector<int> p[M],q;
int mp[N<<3];

inline void Add(int &x,int y){if((x+=y)>=mod) x-=mod;}

int f[2][M],pre[M][10],o;

signed main(){
    freopen("drama.in","r",stdin);
	freopen("drama.out","w",stdout);	
	// int sss=clock();
	n=read(),m=read();
	for(int i=1;i<=n;++i) q.emplace_back(i);
	int cf=pow(10,n-1);
	do{
		p[++idx]=q;
		int hash=0;
		for(int x:q) hash=(hash*base+x);
		mp[hash]=idx;
		int cfs=cf;
		for(int k=0;k<n;++k){
			pre[idx][k]=p[idx][k]*cfs;
			if(k>0) pre[idx][k]+=pre[idx][k-1];
			cfs/=10;
		}
	}while(next_permutation(q.begin(),q.end()));
	
	f[1][1]=1,o=0;
	for(int i=1;i<=m;++i){
		o^=1;
		for(int j=1;j<=idx;++j) f[o^1][j]=0;
		for(int j=1;j<=idx;++j){
			int pr=0;
			for(int k=0;k<n;k++){
				int pr=(k==0)?0:pre[j][k-1]/10;
				int su=pre[j][n-1]-pre[j][k];
				int id=mp[pr+su+p[j][k]*cf];
				Add(f[o^1][id],f[o][j]);
			}
		}
	}
	printf("%lld",f[o^1][1]);
	// int ttt=clock();
	// cerr<<(ttt-sss)*1.0/CLOCKS_PER_SEC<<"second\n";
    return 0;
}